package com.sx.wechat.shiro;

import com.sx.core.model.Information;
import org.apache.shiro.authz.SimpleAuthorizationInfo;

import java.io.Serializable;
import java.util.List;

/**
 * 授权用户信息
 */
public class InformationAuthorizationInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    private Information information;
    private SimpleAuthorizationInfo authorizationInfo=new SimpleAuthorizationInfo();

    public InformationAuthorizationInfo(Information operator, List<String> perms) {
        this.information=operator;
        authorizationInfo.addStringPermissions(perms);
    }

    public Information getOperator() {
        return information;
    }

    public Information getInformation() {
        return information;
    }

    public SimpleAuthorizationInfo getAuthorizationInfo() {
        return authorizationInfo;
    }

    public void setAuthorizationInfo(SimpleAuthorizationInfo authorizationInfo) {
        this.authorizationInfo = authorizationInfo;
    }

    @Override
    public String toString() {
        return information.getId();
    }

}